home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 7_5.lha / 7_5 / 7_5a1_rect.c < prev    next >
Text File  |  1993-08-08  |  513b  |  21 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / Exercise 7.5
  6. / rectangle derived from a line
  7. lass rectangle : public line
  8.  
  9. ublic:
  10.    point north() { return point((w.x+e.x)/2,e.y); }
  11.    point east();
  12.    point south() { return point((w.x+e.x)/2,w.y); }
  13.    point west();
  14.    point neast() { return e; }
  15.    point seast();
  16.    point swest() { return w; }
  17.    point nwest();
  18.    void draw();
  19.    rectangle(point a, point b);
  20. ;
  21.